<template>
  <div class="home">
    <div class="w">
      <el-carousel :interval="3000" arrow="always" height="800px">
        <el-carousel-item v-for="item in images" :key="item.id">
          <img :src="item.url" alt="" />
        </el-carousel-item>
      </el-carousel>
      <div class="search">
        <div class="sanjiao">
          搜索
          <div class="sanjiao1"></div>
        </div>
        <el-input v-model="input" placeholder="请输入房产标题"> </el-input>
        <i class="el-icon-search ico" @click="getPropertyList"></i>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      images: [
        {
          id: 1,
          url: require("@/assets/housefour.png"),
        },
        {
          id: 2,
          url: require("@/assets/housetwo.jpeg"),
        },
        {
          id: 3,
          url: require("@/assets/housethree.jpeg"),
        },
        {
          id: 4,
          url: require("@/assets/houseone.jpeg"),
        },
      ],
      input: "",
    };
  },
  methods: {
    getPropertyList() {
      this.$router.push({
        path: "/pronperty",
        query: { title_contains: this.input, titleName: "搜索" },
      });
    },
  },
};
</script>

<style scoped>
.home {
  height: 800px;
  background-size: 100% 100%;
}
.w {
  height: 700px;
  position: relative;
}
.el-input {
  width: 500px;
}

img {
  height: 799px;
}
.search {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translateX(-50%);
  z-index: 99;
}
.sanjiao {
  background-color: #eeeeee;
  width: 100px;
  height: 40px;
  text-align: center;
  line-height: 40px;
  border-radius: 6px 3px 0 0;
}
::v-deep .search .el-input__inner {
  height: 45px;
  line-height: 45px;
  border-radius: 0 6px 6px;
  border: 1px solid #fff;
}
.ico {
  width: 45px;
  height: 45px;
  position: absolute;
  right: 0px;
  top: 40px;
  text-align: center;
  line-height: 45px;
  font-size: 20px;
  cursor: pointer;
}
.sanjiao1 {
  position: absolute;
  right: 372px;
  top: 0;
  width: 0;
  height: 0;
  border-bottom: 40px solid #eeeeee;
  border-right: 30px solid transparent;
}
</style>
